<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
	<meta name="robots" content="index, follow">
    <link rel="shortcut icon" type="image/png" href="../../../../../../contracts/favicon.png">

	<link rel="stylesheet" type="text/css" href="../../static/css/bootstrap.min.css?9188" th:href="@{/css/bootstrap.min.css?9188}">
	<link rel="stylesheet" type="text/css" href="../../static/css/style.css?8116" th:href="@{/css/style.css?8116}">
	<link rel="stylesheet" type="text/css" href="../../static/css/animate.min.css?7456" th:href="@{/css/animate.min.css?7456}">
	<link href='https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
	<link href='https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900&display=swap&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
    <title>modify_customers</title>


    
<!-- Analytics -->
 
<!-- Analytics END -->
    
</head>
<body>

<!-- Preloader -->
<div id="page-loading-blocs-notifaction" class="page-preloader"></div>
<!-- Preloader END -->


<!-- Main container -->
<div class="page-container">
    
<!-- bloc-0 -->
<div class="bloc bg1 bgc-azure l-bloc" id="bloc-0">
	<div class="container bloc-sm">
		<div class="row">
			<div class="col">
				<nav th:replace="_fragments :: nav" class="navbar navbar-light row navbar-expand-md nav-invert" role="navigation">
					<button id="nav-toggle" type="button" class="ui-navbar-toggler navbar-toggler border-0 p-0" data-toggle="collapse" data-target=".navbar-27707" aria-expanded="false" aria-label="Toggle navigation">
						<span class="navbar-toggler-icon"></span>
					</button>
					<div class="collapse navbar-collapse navbar-27707">
						<ul class="site-navigation nav navbar-nav">
							<li class="nav-item">
								<a href="loginup.html" th:href="@{/}" class="nav-link a-btn ltc-white">首页</a>
							</li>
							<li th:if="${session.nowUser.ifHasRight(1)}" class="nav-item">
								<a href="contract/draft.html" th:href="@{/toDraft}" class="nav-link  ltc-white">起草合同</a>
							</li>
							<li th:if="${session.nowUser.ifHasRight(5)}" class="nav-item">
								<a href="select.html" th:href="@{/toCounterSign}" class="nav-link  ltc-white">会签合同</a>
							</li>
							<li th:if="${session.nowUser.ifHasRight(2)}" class="nav-item">
								<a href="finalization.html" th:href="@{/toFinalize}" class="nav-link a-btn ltc-white">定稿合同</a>
							</li>
							<li th:if="${session.nowUser.ifHasRight(6)}" class="nav-item">
								<a href="approval.html" th:href="@{/toExamine}" class="nav-link a-btn ltc-white">审批合同</a>
							</li>
							<li th:if="${session.nowUser.ifHasRight(7)}" class="nav-item">
								<a href="sign.html" th:href="@{/toSign}" class="nav-link a-btn ltc-white">签订合同</a>
							</li>
						</ul>
					</div>
					<a class="navbar-brand mr-0" href="/toMe"> xzx <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16"><path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg></a>

				</nav>
			</div>
		</div>
	</div>
</div>
<!-- bloc-0 END -->

<!-- bloc-19 -->
<div class="bloc l-bloc bg2" id="bloc-19">
	<div class="container bloc-lg">
		<div class="row" style="background-color: rgba(255, 255, 255, .2);">
			<div class="col-sm-10 offset-sm-1 col-md-8 offset-md-2 col-lg-6 offset-lg-3 text-md-left text-center">
				<form id="form" th:action="@{/customer/modify}" method="post" enctype="multipart/form-data">
				<h1 class="mg-md">
					修改客户信息
				</h1>
					<div class="form-group">
						<label>
							姓名<br>
						</label>
						<input name="customername" id="name_26551" th:value="${customerObject.customername}"class="form-control" />
						<div style="color:red">
							<label v-show="cun">客户名不能为空!</label>
						</div>
					</div>
					<div class="form-group">
						<label>
							电话<br>
						</label>
						<input name="phone" id="name_26552" th:value="${customerObject.phone}"class="form-control" />
						<div style="color:red">
							<label v-show="cup">电话不能为空!</label>
						</div>
					</div>
					<div class="form-group">
						<label>
							地址<br>
						</label>
						<input name="address" id="name_26553" th:value="${customerObject.address}" class="form-control" />
					</div>
					<div class="form-group">
						<label>
							邮箱<br>
						</label>
						<input name="email" id="name_26554" th:value="${customerObject.email}"class="form-control" />
						<div style="color:red">
							<label v-show="cue">邮箱不能为空!</label>
						</div>
					</div>
					<div class="form-group">
						<label>
							银行名称<br>
						</label>
						<input name="bank" id="name_26555" th:value="${customerObject.bank}"class="form-control" />
					</div>
					<div class="form-group">
						<label>
							银行账号<br>
						</label>
						<input name="account" id="name_26556" th:value="${customerObject.account}"class="form-control" />
				</div>
				<div class="form-group">
					<label>
						备注<br>
					</label><textarea id="name_26557" class="form-control" th:value="${customerObject.remark}" rows="4" cols="50"></textarea>
				</div>
				<button v-on:click="send()" class="bloc-button btn btn-lg btn-block btn-azure" type="button">
					提交<br>
				</button>
				</form>
			</div>
		</div>
	</div>
</div>
<!-- bloc-19 END -->

<!-- ScrollToTop Button -->
<a class="bloc-button btn btn-d scrollToTop" onclick="scrollToTarget('1',this)"><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 32 32"><path class="scroll-to-top-btn-icon" d="M30,22.656l-14-13-14,13"/></svg></a>
<!-- ScrollToTop Button END-->


<!-- bloc-2 -->
<div class="bloc l-bloc" id="bloc-2">
	<div class="container bloc-lg">
		<div class="row">
			<div class="col-12">
				<h5 class="mg-md text-lg-center">
					Thank ♥ You
				</h5>
				<p class="text-lg-center">
					Renxiang Jia,2024
				</p>
			</div>
		</div>
	</div>
</div>
<!-- bloc-2 END -->

</div>
<!-- Main container END -->
    


<!-- Additional JS -->
<script th:src="@{/js/jquery.min.js}" src="../../static/js/jquery.min.js?7482"></script>
<script th:src="@{/js/bootstrap.bundle.min.js?6777}" src="../../static/js/bootstrap.bundle.min.js?6777"></script>
<script th:src="@{/js/blocs.min.js?2512}" src="../../static/js/blocs.min.js?2512"></script>
<script th:src="@{/js/lazysizes.min.js}" src="../../static/js/lazysizes.min.js" defer></script>
<script th:src="@{/js/jquery.min.js}"  type="text/javascript" charset="utf-8"></script>
<script th:src="@{/js/vue.js}"  type="text/javascript" charset="utf-8"></script>
<script th:src="@{/js/axios.min.js}"  type="text/javascript" charset="utf-8"></script>

<script>
    var customer=new Vue({
        el:"#form",  //作用范围：id=form_38623的标签及其内部
        data () {
            return {
                cun:false,
                cup:false,
                cue:false
            }
        },
        methods:{
            send:function (){
                var customername =  $("#name_26551").val();
                var phone = $("#name_26552").val();
                var address = $("#name_26553").val();
                var email = $("#name_26554").val();
                var bank = $("#name_26555").val();
                var account = $("#name_26556").val();
                var remark = $("#name_26557").val();
                var customerid = [[${customerObject.customerid}]];
                this.cue=false;
                this.cun=false;
                this.cup=false;
                if(customername.length==0){
                    this.cun=true;
				}
                if(phone.length==0){
                    this.cup=true;
                }
                if(email.length==0){
                    this.cue=true;
                }
                if(!this.cue){
                    if(!this.cun){
                        if(!this.cup){
                            axios({
                                method: "post",
                                url: "/customer/modify",
                                params:{
                                    customerid:customerid,
                                    customername:customername,
                                    phone:phone,
                                    address:address,
                                    email:email,
                                    bank:bank,
                                    account:account,
                                    remark:remark
                                }
                            })
                                .then(function (value) {
                                    if((String)(value.data)==="200") {
                                        alert("修改成功");
                                    }else{
                                        alert("修改失败");
                                    }
                                })
                                .catch();
						}
					}
				}

            }
        }
    })
</script>
</body>
</html>
